<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>农汇购-新增商家</title>
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/layui/css/layui.css" rel="stylesheet">
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/layui/layui.js"></script>
</head>
<body>
	<form class="layui-form" action="/addUser">
	  <div class="layui-form-item">
	    <label class="layui-form-label">账号</label>
	    <div class="layui-input-block">
	      <input type="text" name="account" required  lay-verify="required" placeholder="请输入账号信息" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">手机号</label>
	    <div class="layui-input-block">
	      <input type="text" name="phone" required  lay-verify="required" placeholder="请输入商家绑定手机号" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	</form>
 
<script>

var layer;
layui.use('form', function(){
  var form = layui.form;
  layer = layui.layer;
  //提交
  form.on('submit(formDemo)', function(datas){
    $.ajax({
		//请求路径
		url:"/rj2002/admin/addUser",
		//请求方式 get post ...
		type:"post",
		dataType:"json",
		data:{
			'account':datas.field.account,
			'phone':datas.field.phone
		},
		//请求成功后做的事情
		success:function(data){
			layer.msg(data);
		},
		//请求失败后做的事情
		error:function(XMLHttpRequest,textStatus,errorThrown){
			layer.msg(XMLHttpRequest.responseText);
		}
	});
    return false;
  });
});
</script>
</body>
</html>